package com.ygqh.baby.po;

import com.ygqh.baby.ao.*;

import java.math.BigDecimal;
import java.util.Date;

public class YgUserBalanceDetail implements Cloneable {
	private Long id;

	private Long userId;

	private BigDecimal incomePayPrice;

	private BigDecimal balancePrice;

	private BalanceType priceType;

	private OperationType operationType;

	private String operation;

	private String orderId;

	private Long orderDetailId;

	private String productName;

	private BigDecimal commissionRate;

	private BigDecimal orderPrice;

	private String remark;

	private String createBy;

	private Date createTime;

	private Date updateTime;

	private OrderStatus orderStatus;

	private RebateType rebateType;

	private Long commissionId;

	private YgUser user;

	private CommissionStatus commissionStatus;

    private Boolean isGived;

    private String platformNo;

	// ==============================================
	private BigDecimal commissionPrice;
	// 累计提现金额（针对某一条可提现金额）
	private BigDecimal commissionDetailPrice;

	public YgUserBalanceDetail() {
		super();
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof YgUserBalanceDetail) {
			YgUserBalanceDetail ubd = (YgUserBalanceDetail) obj;
			if (userId == null || ubd.getUserId() == null || orderId == null || ubd.getOrderId() == null || orderDetailId == null
					|| ubd.getOrderDetailId() == null || rebateType == null || ubd.getRebateType() == null) {
				return false;
			}
			if (userId.equals(ubd.getUserId())
					&& orderId.equals(ubd.getOrderId())
					&& orderDetailId.equals(ubd.getOrderDetailId())
					&& rebateType.equals(ubd.getRebateType())
					&& priceType.equals(ubd.getPriceType())
					&& operationType.equals(ubd.operationType)) {
				return true;
			}
		}
		return false;
	}

	public Long getOrderDetailId() {
		return orderDetailId;
	}

	public void setOrderDetailId(Long orderDetailId) {
		this.orderDetailId = orderDetailId;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public OperationType getOperationType() {
		return operationType;
	}

	public void setOperationType(OperationType operationType) {
		this.operationType = operationType;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Long getCommissionId() {
		return commissionId;
	}

	public void setCommissionId(Long commissionId) {
		this.commissionId = commissionId;
	}

	public CommissionStatus getCommissionStatus() {
		return commissionStatus;
	}

	public void setCommissionStatus(CommissionStatus commissionStatus) {
		this.commissionStatus = commissionStatus;
	}

	public BigDecimal getCommissionDetailPrice() {
		return commissionDetailPrice;
	}

	public void setCommissionDetailPrice(BigDecimal commissionDetailPrice) {
		this.commissionDetailPrice = commissionDetailPrice;
	}

	public RebateType getRebateType() {
		return rebateType;
	}

	public void setRebateType(RebateType rebateType) {
		this.rebateType = rebateType;
	}

	public OrderStatus getOrderStatus() {
		return orderStatus;
	}

	public void setOrderStatus(OrderStatus orderStatus) {
		this.orderStatus = orderStatus;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public BigDecimal getIncomePayPrice() {
		return incomePayPrice;
	}

	public void setIncomePayPrice(BigDecimal incomePayPrice) {
		this.incomePayPrice = incomePayPrice;
	}

	public BigDecimal getBalancePrice() {
		return balancePrice;
	}

	public void setBalancePrice(BigDecimal balancePrice) {
		this.balancePrice = balancePrice;
	}

	public BalanceType getPriceType() {
		return priceType;
	}

	public void setPriceType(BalanceType priceType) {
		this.priceType = priceType;
	}

	public String getOperation() {
		if (this.operationType != null) {
			return operation = this.operationType.getTitle();
		} else {
			return operation;
		}
	}

	public void setOperation(String operation) {
		this.operation = operation == null ? null : operation.trim();
	}

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public BigDecimal getCommissionRate() {
		return commissionRate;
	}

	public void setCommissionRate(BigDecimal commissionRate) {
		this.commissionRate = commissionRate;
	}

	public BigDecimal getOrderPrice() {
		return orderPrice;
	}

	public void setOrderPrice(BigDecimal orderPrice) {
		this.orderPrice = orderPrice;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark == null ? null : remark.trim();
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCreateBy() {
		return createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	public YgUser getUser() {
		return user;
	}

	public void setUser(YgUser user) {
		this.user = user;
	}

	public BigDecimal getCommissionPrice() {
		return commissionPrice;
	}

	public void setCommissionPrice(BigDecimal commissionPrice) {
		this.commissionPrice = commissionPrice;
	}

	@Override
	public YgUserBalanceDetail clone() {
		YgUserBalanceDetail detail = null;
		try {
			detail = (YgUserBalanceDetail) super.clone();
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return detail;
	}

	public Boolean getIsGived() {
		return isGived;
	}

	public void setIsGived(Boolean isGived) {
		this.isGived = isGived;
	}

    public String getPlatformNo() {
        return platformNo;
    }

    public void setPlatformNo(String platformNo) {
        this.platformNo = platformNo;
    }
}